package com.changcheng.project.yuminsi.enums;

/**
 * @author yuminsi
 * @description
 * @date 2020/8/22 22:48
 * @since
 */
public enum OrderStatus {
    /**
     * 订单状态
     */
    ORDER_STATUS_0("有订单","0"),
    /**
     * 无订单
     */
    ORDER_STATUS_1("无订单","1");

    private String name;
    private String code;

    OrderStatus() {
    }

    OrderStatus(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public static OrderStatus getOrderStatus(String code){
        for (OrderStatus status:values()){
            if (status.getCode().equals(code)){
                return status;
            }
        }
        return null;
    }
}


